<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>drag effect</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        ul li{
            list-style: none;
        }
        .main{
            margin:10px auto;
        }
        .img-cntr{
            width: 100%;
        }
        .img-cntr:after{
            display: block;
            height: 0;
            overflow: hidden;
            clear: both;
            content: '';
        }
        .img-cntr li{
            width:200px;
            height: 150px;
            float:left;
            margin: 5px 10px;
            position: relative;
            top: 0;
            left: 0;
        }
        .img-cntr li img{
            width: 100%;
            max-height: 100%;
            vertical-align: middle;
        }
        li.select{
            width: 198px;
            height:148px;
            border: 1px dashed gray;

        }
        li.select img{

            opacity: 0.5;
        }
        .img-cntr li span{
            display: block;
            width: 20px;
            height: 20px;
            border-radius: 10px;
            background-color: rgba(0,0,0,1);
            color: #fff;
            position: absolute;
            right: -10px;
            top:-10px;
            text-align: center;
            line-height: 20px;
            cursor: pointer;
        }
        .move{
            position:absolute;
            border: 1px solid dashed;
        }
    </style>
</head>
<body>
    <div class="main">
        <ul class="img-cntr" id='scroll1'>
            <li><img src="./img/1.jpg"><span>X</span></li>
            <li><img src="./img/2.jpg"><span>X</span></li>
            <li><img src="./img/3.jpg"><span>X</span></li>
            <li><img src="./img/4.jpg"><span>X</span></li>
            <li><img src="./img/5.jpg"><span>X</span></li>
            <li><img src="./img/6.jpg"><span>X</span></li>
            <li><img src="./img/7.jpg"><span>X</span></li>
            <li><img src="./img/8.jpg"><span>X</span></li>
            <li><img src="./img/1.jpg"><span>X</span></li>
            <li><img src="./img/2.jpg"><span>X</span></li>
            <li><img src="./img/3.jpg"><span>X</span></li>
            <li><img src="./img/4.jpg"><span>X</span></li>
            <li><img src="./img/5.jpg"><span>X</span></li>
            <li><img src="./img/6.jpg"><span>X</span></li>
            <li><img src="./img/7.jpg"><span>X</span></li>
            <li><img src="./img/8.jpg"><span>X</span></li>
        </ul>
    </div>
    <script src='./jquery.js'></script>
    <script src='./drag.js'></script>
    <script>
        function clickCallBack(e,$this,$moveChild){
            console.log($this)
            $this.css('visibility','visible')
            $this.addClass('select')
        }
        function endCallBack(e,$this,$moveChild){
            $this.removeClass('select')
        }
        function moveCallBack(e,$this,$moveChild,lastIndex){
            console.log(lastIndex)
        }
        $('.img-cntr li span').mousedown(function(){
            $(this).parent().remove()
            return false
        })
        Drag({cntr:'.img-cntr',child:'li',clickCallBack:clickCallBack,endCallBack:endCallBack,moveCallBack:moveCallBack})
    </script>
</body>
</html>